Skip to content

Remove custom translate() helper from CheckPhase — let BentoBox handle MiniMessage natively#485

Merged
tastybento merged 5 commits intodevelopfrom
copilot/sub-pr-484
Apr 7, 2026
Merged

Remove custom translate() helper from CheckPhase — let BentoBox handle MiniMessage natively#485
tastybento merged 5 commits intodevelopfrom
copilot/sub-pr-484

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 6, 2026

  • Revert CheckPhase.java to use user.sendMessage() directly (no custom translate() helper)
  • Fix CheckPhaseTest: restore showTitle() Adventure API in CheckPhase.setNewPhase()
  • Fix InfoListenerTest: replace spigot.sendMessage() verification with lm.get() verification
    • Removed local @Mock private Spigot spigot field and checkSpigotMessage() override
    • Removed unused imports (TextComponent, ArgumentCaptor, List, atLeast, Player.Spigot)
    • testOnInfo: now verifies lm.get(any(User.class), eq("aoneblock.commands.info.count"))
    • testOnInfoOtherAddon: now verifies lm.get() was never called with that key
    • player.spigot() still wired to inherited spigot from CommonTestSetup to prevent NPE in current BentoBox's sendRawMessage()

…custom translate() with LegacyComponentSerializer

Agent-Logs-Url: https://github.com/BentoBoxWorld/AOneBlock/sessions/3ae91a34-99b8-44ae-bdce-bc776883a2f9

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Copilot AI changed the title [WIP] [WIP] Address feedback on Version 1.23.0 regarding MiniMessage support Remove custom translate() helper from CheckPhase — let BentoBox handle MiniMessage natively Apr 6, 2026
Copilot AI requested a review from tastybento April 6, 2026 05:11
@tastybento tastybento marked this pull request as ready for review April 6, 2026 14:50
@tastybento
Copy link
Copy Markdown
Member

@copilot Fix the tests that were broken by this change

… LegacyComponentSerializer)

Agent-Logs-Url: https://github.com/BentoBoxWorld/AOneBlock/sessions/e8854ea2-7b56-497a-ac76-533846ce7957

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 6, 2026

@copilot Fix the tests that were broken by this change

Fixed in commit 5123896. The previous revert was too aggressive and reverted to the deprecated Bukkit sendTitle(), but the tests verify showTitle(any(Title.class)). Restored showTitle() using Component.text(newPhaseName) and Title.title() — no LegacyComponentSerializer needed.

@tastybento
Copy link
Copy Markdown
Member

@copilot There is still a test error:
Error: Failures:
Error: InfoListenerTest.testOnInfo:113->checkSpigotMessage:121->checkSpigotMessage:150 Expected message occurrence mismatch: aoneblock.commands.info.count ==> expected: <1> but was: <0>
[INFO]
Error: Tests run: 394, Failures: 1, Errors: 0, Skipped: 2

…t.sendMessage()

Agent-Logs-Url: https://github.com/BentoBoxWorld/AOneBlock/sessions/b792d2e9-3944-46fa-9f8e-2339f94967e8

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 6, 2026

@copilot There is still a test error:
Error: Failures:
Error: InfoListenerTest.testOnInfo:113->checkSpigotMessage:121->checkSpigotMessage:150 Expected message occurrence misma...

Fixed in commit 06a5bee. Updated InfoListenerTest to verify through the LocalesManager (lm.get()) instead of spigot.sendMessage():

  • testOnInfo: verify(lm).get(any(User.class), eq("aoneblock.commands.info.count"))
  • testOnInfoOtherAddon: verify(lm, never()).get(any(User.class), eq("aoneblock.commands.info.count"))

Removed the local spigot mock, the checkSpigotMessage() override, and all the related unused imports (TextComponent, ArgumentCaptor, List, atLeast, Player.Spigot).

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 7, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
B Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@tastybento tastybento merged commit b69a5f7 into develop Apr 7, 2026
2 of 3 checks passed
@tastybento tastybento deleted the copilot/sub-pr-484 branch April 7, 2026 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants